Subject: Re: Render Settings
From: Allen D Hastings <[email-masked]>
To: [email-masked]
Date: Fri, 26 Aug 1994 03:17:29 -0700

>From a realism standpoint, hard shadows are more accurate for space scenes.
>But there is also the fact that shadow maps in LW still have some problems.
>One that I find particularly annoying is that they can sometimes be offset
>from the shadow casting object. This can cause an object sitting on the floor
>or attached to a wall to appear to be floating. 

I'm afraid this offset is a necessary evil when shadow mapping, and is
there to prevent surfaces from erroneously shadowing themselves.  A
good discussion of the offset, usually called "bias", can be found in the
classic paper on shadow mapping in the SIGGRAPH '87 Proceedings, written
by some folks at Pixar:  Bill Reeves, David Salesin, and Rob Cook (I had
the pleasure of talking with Bill when we found ourselves in the same row
on the flight home from SIGGRAPH this year - hope I didn't bug him too
much).

Most systems make the user type in a fixed bias value, or the upper and
lower limits of a range from which bias values are chosen at random.
This requires the user to be either a math genius or to use lots of
trial and error, neither of which sounded good to me, so for LightWave I
figured out a way to automatically compute the needed bias value on the
fly.  This has the added advantage that the bias value is customized for
each pixel being rendered, based on its distance from the light, its
angle to the light, the cone angle, and the shadow map resolution.  

However, after reading Mark's complaint above, I re-examined the formula
and discovered that it wasn't quite right, being too conservative most
of the time (too much bias, thus a more noticeable offset as Mark says).
I'm now using a new formula that produces better results, and it will be
in LightWave 4.0. 

The best way to reduce the bias amount is to increase the shadow map
resolution.  LightWave's default 512 x 512 size is considered rather
small.  For example, in Luxo Jr., the first major animation to use Pixar's
shadow mapping method, the sizes of the three shadow maps used were
1024 x 1024, 1024 x 1024, and 2048 x 2048 (a total of 24 megabytes)!

- AH